<template>
  <a-modal width="45vw" title="提示" title-align="start" :closable="false" :mask-closable="false" v-model:visible="visible">
    <div>当前有其他进程任务，请不要关闭页面，请稍后...</div>
    <template #footer>
      <a-space>
        <a-button @click="onCancel"> 关闭，稍后再尝试 </a-button>
      </a-space>
    </template>
  </a-modal>
</template>

<script setup lang="ts">
  import { computed } from 'vue'
  interface IProps {
    modelValue: boolean
  }

  const emits = defineEmits(['cancel', 'update:modelValue'])
  const props = withDefaults(defineProps<IProps>(), {
    modelValue: false,
  })

  const visible = computed({
    get: () => props.modelValue,
    set: (val) => emits('update:modelValue', val),
  })

  const onCancel = () => {
    emits('cancel')
    emits('update:modelValue', false)
  }
</script>

<style lang="less" scoped></style>
